<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var arr = ['a', 'a', 's', 'f', 'w', 's', 'c']
      function unique(Array) {
        var nArray = []
        for (i = 0; i < Array.length; i++) {
          if (nArray.indexOf(Array[i]) == -1) {
            nArray.push(Array[i])
          }
        }
        return nArray
      }
      console.log(unique(arr))
      // console.log(typeof arr)
    </script>
  </body>
</html>
